<template>
	<view class="login_bg">
		<view class="dongtai_top">
			<view class="menuList">
				<view :class="(currIndex==index) ? 'curr' : ''" v-for="(item,index) in menuList" @click="catchTab(index)">{{item}}</view>
			</view>
			<view class="dongtai_top_img" @click="send_messagee()">
				<image src="../../static/images/public_btn-c2051d9a.png" mode="widthFix"></image>
			</view>
		</view>
		
		<view v-show="currIndex==0">
			<view class="dongtai_top_list">
				<view class="dongtai_top_list_li"  @click="userDetail(item.id)" v-for="(item,index) in TrendsList.data">
					<view class="dongtai_top_list_li_xf">
						<view class="dongtai_top_list_li_xff">
							<view class="pic"><image src="../../static/images/w270_h270_qm.png" mode="widthFix"></image></view>
							<view>
								<view class="dtt_name">
									<view class="ssex">
										<p class="dt_name">{{item.user.nickname}}</p>
										<view class="pic_sex"  :style="{background:'url('+cdnUrl+'/'+item.album_list[0].file_path+')'}"></view>
									</view>
									
									<view class="yanzhi"><image src="../../static/images/ico.png" mode="widthFix"></image></view>
								</view>
							</view>
							<p class="dongtai_sex">下午好呀，有空呀</p>
							<view class="dt_tt">
								<view class="timee">
									<view class="time"><image src="../../static/images/time.png" mode="widthFix"></image></view>
									<view class="dt_txt">
										<p class="dt_time">1小时前</p>
										<p class="dt_city">天津市</p>
									</view>
								</view>
								<view class="more">全文>></view>
							</view>
							<view class="dt_tp"><image src="../../static/images/w270_h270_qm.png" mode="widthFix"></image></view>
						</view>
						<view class="dt_zan">
							<view class="zann">
								<view class="zan"><image src="../../static/images/icon_message-d31b75e0.png" mode="widthFix"></image></view>
								<p class="dianzan">留言</p>
							</view>
							<view class="lyy">
								<view class="ly"><image src="../../static/images/icon_ZAN-8829f78a.png"  mode="widthFix"></image></view>
								<p class="lly">点赞</p>
							</view>
						</view>
					</view>
					<view>
						<view class="dongtai_top_list_li_img"><image src="../../static/images/dt_01.png" mode="widthFix"></image></view>
						<view class="zzc"></view>
					</view>
				</view>

			</view>
		</view>
		<view v-show="currIndex==1">
			<view class="dongtai_top_list">
				<view class="dongtai_top_list_li"   @click="userDetail(item.id)" v-for="(item,index) in TrendsList.data">
					<view class="dongtai_top_list_li_xf">
						<view class="dongtai_top_list_li_xff">
							<view class="pic"><image :src="`${cdnUrl}/${item.file_path}`" mode="widthFix"></image></view>
							<view>
								<view class="dtt_name">
									<view class="ssex">
										<p class="dt_name">{{item.user.nickname}}</p>
										<view class="pic_sex"><image src="../../static/images/icon_girl-7cf09ca4.png" mode="widthFix"></image></view>
									</view>
									
									<view class="yanzhi"><image src="../../static/images/ico.png" mode="widthFix"></image></view>
								</view>
							</view>
							<p class="dongtai_sex">下午好呀，有空呀</p>
							<view class="dt_tt">
								<view class="timee">
									<view class="time"><image src="../../static/images/time.png" mode="widthFix"></image></view>
									<view class="dt_txt">
										<p class="dt_time">1小时前</p>
										<p class="dt_city">天津市</p>
									</view>
								</view>
								<view class="more">全文>></view>
							</view>
							<view class="dt_tp"><image src="../../static/images/w270_h270_qm.png" mode="widthFix"></image></view>
						</view>
						<view class="dt_zan">
							<view class="zann">
								<view class="zan"><image src="../../static/images/icon_message-d31b75e0.png" mode="widthFix"></image></view>
								<p class="dianzan">留言</p>
							</view>
							<view class="lyy">
								<view class="ly"><image src="../../static/images/icon_ZAN-8829f78a.png" mode="widthFix"></image></view>
								<p class="lly">点赞</p>
							</view>
						</view>
					</view>
					<view>
						<view class="dongtai_top_list_li_img"><image src="../../static/images/dt_01.png" mode="widthFix"></image></view>
						<view class="zzc"></view>
					</view>
				</view>
			</view>
		</view>
		<view v-show="currIndex==2">
			<view class="dongtai_top_list">
			<view class="dongtai_top_list_li">
				<view class="dongtai_top_list_li_xf">
					<view class="dongtai_top_list_li_xff">
						<view class="pic"><image src="../../static/images/w270_h270_qm.png" mode="widthFix"></image></view>
						<view>
							<view class="dtt_name">
								<view class="ssex">
									<p class="dt_name">静静</p>
									<view class="pic_sex"><image src="../../static/images/icon_girl-7cf09ca4.png" mode="widthFix"></image></view>
								</view>
								
								<view class="yanzhi"><image src="../../static/images/ico.png" mode="widthFix"></image></view>
							</view>
						</view>
						<p class="dongtai_sex">下午好呀，有空呀</p>
						<view class="dt_tt">
							<view class="timee">
								<view class="time"><image src="../../static/images/icon_time-6b856ff4.png" mode="widthFix"></image></view>
								<view class="dt_txt">
									<p class="dt_time">1小时前</p>
									<p class="dt_city">天津市</p>
								</view>
							</view>
							<view class="more">全文>></view>
						</view>
						<view class="dt_tp"><image src="../../static/images/w270_h270_qm.png" mode="widthFix"></image></view>
					</view>
					<view class="dt_zan">
						<view class="zann">
							<view class="zan"><image src="../../static/images/icon_message-d31b75e0.png"></image></view>
							<p class="dianzan">留言</p>
						</view>
						<view class="lyy">
							<view class="ly"><image src="../../static/images/icon_ZAN-8829f78a.png"></image></view>
							<p class="lly">点赞</p>
						</view>
					</view>
				</view>
				<view>
					<view class="dongtai_top_list_li_img"><image src="../../static/images/dt_01.png" mode="widthFix"></image></view>
					<view class="zzc"></view>
				</view>
			</view>
			</view>
		</view>
		<footerVue :currIndex="1"></footerVue>
<!-- 		<view>
			<uni-popup ref="popup" :type="tt" :animation="false" :maskClick="true" @change="changee" >
			            <view class="aitlce">
							<view class="more_cz">更多操作</view>
							<view class="lahei">
								<view class="lahei_01">拉黑</view>
								<view class="lahei_01">举报</view>
							</view>
							<view class="qxcz"  @click="closee">
								<view class="lahei_02">取消</view>
							</view>
			            </view>
			</uni-popup>
		</view> -->

</view>	
</template>

<script>
  import request from '../../utils/http.js'
  import footerVue from '../../components/public/footer.vue'
  export default {
    data() {
      return {
				// indicatorDots:true,
				autoplay:true,
				interval:5000,
				duration:500,
				bannerEable:true,
				bs:false,
				isCheckeddd:false,
				menuList:['关注','动态','周边'],
				currIndex:0,
				currIndex1:0,
				// showPopup: false, // 控制弹出层的显示和隐藏  
				isPopupShow: false,
				tt: 'bottom',
				page:1,
				TrendsList:[],
				showType:1
				
      }
    },
	components:{
		footerVue
	},
	computed:{
		cdnUrl(){
			return uni.cdnURL
		}
	},
	mounted() {
		this.getTrendsData()
	},
    methods: {
		toggle(tt) {
		    this.type = tt;
		    this.$refs['popup'].open();
		},
     	catchTab(index){
     		this.currIndex = index,
			this.showType = index*1+1
     	},
     	catchTabb(index1){
     		this.currIndex1 = index1
     	},
     	open(){
     		// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ，type 属性将失效 ，仅支持 ['top','left','bottom','right','center']
     		this.$refs.popup.open('bottom')
     	},
		getTrendsData(){
			let gender = uni.getStorageSync("sex")
			request({
				url: '/Trends/trendsList',
				method:'post',
				data: {gender:gender,page:this.page,showtype:this.showType},
			}).then(res => {
				let result = res.data;
				if(result.code==1){
					this.TrendsList = result.data
					// console.log(result.data.rem_list)
				}
			}).catch(err => {
			  console.error(err);
			});
		}
    },
			
  }
</script>
<style>
  @import "../../static/css/dongtai.css";
</style>
